package web

import (
	"fmt"
	"net/http"
	"time"
)

type HandleHello struct{}

func (receiver *HandleHello) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
	fmt.Fprintln(writer, "hello world!!!", request.URL.Path)
}

func HttpMain() {
	http.Handle("/", &HandleHello{})

	server := http.Server{
		Addr:              ":8088",
		Handler:           &HandleHello{},
		ReadHeaderTimeout: 2 * time.Second,
	}
	server.ListenAndServe()
}
